package hxy.dragon.compose.composables

import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.Icon
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.TextFieldColors
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.input.VisualTransformation
import hxy.dragon.compose.R

@Composable
fun MyTextField(
    value: String, colors: TextFieldColors, trailingtintIcon: Color,
    trailingIcon: ImageVector,
    modifier: Modifier,
    painter: Painter,
    keyboardOptions: KeyboardOptions,
    visualTransformation: VisualTransformation = VisualTransformation.None,
    onValueChange: (String) -> Unit
) {
    OutlinedTextField(
        value = value, colors = colors, trailingIcon = {
            Icon(
                painter = painter,
                contentDescription = "",
                tint = trailingtintIcon
            )
        },
        singleLine = true,
        onValueChange = onValueChange
    )
}